package java3_23.Zoo;
//大象 子类
public class Elephant extends Mammal implements Swimming{

    public Elephant(String name, String sex, String type) {
        super(name, sex, type);
    }

    @Override
    public void eat() {
        System.out.println(getType()+getName()+"正在吃水果");
    }

    @Override
    public void play() {
        System.out.println(getType()+getName()+"正在河里玩耍");
        Elephant.this.swim();
    }

    @Override
    public void swim() {
        System.out.println(getType()+getName()+"正在游泳");
    }
}
